Repository navigation
mcp: filters for find_related, dedupe defs out of refs BM25 hits - #7
Merged
Merged
Conversation
Two related improvements addressing audit-time friction in the "find related code" workflow. find_related filters: VelesIndex::find_related now accepts filter_languages and filter_paths in the same shape as `search`. The historical "default to source chunk's language" stays in effect when both are None, so existing callers (CLI, gRPC, TUI) keep their behaviour without changes beyond the new None / None arguments. The MCP find_related tool exposes lang / path / exclude args and threads them through filter::resolve_path_filter, so an agent can say "show me related code, but only under crates/veles-mcp/**" and have the candidate set restricted exactly that way. refs dedupe: when a BM25 hit's chunk contains a definition's start line, the chunk is the same code the Definitions section already pointed at — drop it from the BM25 list. The handler now requests ~50% extra BM25 hits to compensate for dropped duplicates, so the post-filter result count is closer to the requested top_k.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two related improvements addressing audit-time friction in the "find related code" workflow.
find_related filters: VelesIndex::find_related now accepts filter_languages and filter_paths in the same shape as
search. The historical "default to source chunk's language" stays in effect when both are None, so existing callers (CLI, gRPC, TUI) keep their behaviour without changes beyond the new None / None arguments.The MCP find_related tool exposes lang / path / exclude args and threads them through filter::resolve_path_filter, so an agent can say "show me related code, but only under crates/veles-mcp/**" and have the candidate set restricted exactly that way.
refs dedupe: when a BM25 hit's chunk contains a definition's start line, the chunk is the same code the Definitions section already pointed at — drop it from the BM25 list. The handler now requests ~50% extra BM25 hits to compensate for dropped duplicates, so the post-filter result count is closer to the requested top_k.